﻿<%@ Page Title="" Language="C#" AutoEventWireup="true" CodeFile="Main.aspx.cs" Inherits="Main" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <script type="text/javascript">
        var addTab = function (tabPanel, id, url) {
            var tab = tabPanel.getComponent(id);

            if (!tab) {
                tab = tabPanel.add({
                    id: id,
                    title: url,
                    closable: true,
                    autoLoad: {
                        showMask: true,
                        url: url,
                        mode: "iframe",
                        maskMsg: "Loading " + url + "..."
                    }
                });

                tab.on("activate", function () {
                    var item = MenuPanel1.menu.items.get(id + "_item");

                    if (item) {
                        MenuPanel1.setSelection(item);
                    }
                }, this);
            }

            tabPanel.setActiveTab(tab);
        }
    </script>
</head>
<body>
    <ext:ResourceManager ID="ResourceManager1" runat="server" />
    <ext:Viewport ID="Viewport1" runat="server" Layout="border">
        <Items>
            <ext:Panel ID="Panel1" runat="server" Title="" Region="North" Split="true" Height="50"
                Padding="6" Html="North" Collapsible="true" />
            <ext:Panel ID="Panel2" runat="server" Title="栏目" Region="West" Layout="accordion"
                Width="225" MinWidth="225" MaxWidth="400" Split="true" Collapsible="true">
                <Items>
                    <ext:MenuPanel Icon="Accept" ID="MenuPanel1" Title="Action" runat="server" Width="200"
                        Region="West">
                        <Menu ID="Menu1" runat="server">
                            <Items>
                                <ext:MenuItem runat="server" Text="生成内容">
                                    <Listeners>
                                        <Click Handler="addTab(#{TabPanel1}, 'idCltg', 'Genetate.aspx');" />
                                    </Listeners>
                                </ext:MenuItem>
                                <ext:MenuSeparator />  
                                 <ext:MenuItem ID="MenuItem4" runat="server" Text="生成页面">
                                    <Listeners>
                                        <Click Handler="addTab(#{TabPanel1}, 'idClt', 'Genetatefrompage.aspx');" />
                                    </Listeners>
                                </ext:MenuItem>
                            </Items>
                        </Menu>
                    </ext:MenuPanel>
                    <ext:MenuPanel ID="MenuPanel2" Icon="FolderWrench" Title="Setting" runat="server"
                        Width="200" Region="West">
                        <Menu ID="Menu2" runat="server">
                            <Items>
                                <ext:MenuItem runat="server" Text="店铺设置">
                                    <Listeners>
                                        <Click Handler="addTab(#{TabPanel1}, 'idCltsm', 'StoreManage.aspx');" />
                                    </Listeners>
                                </ext:MenuItem>
                                <ext:MenuSeparator />
                                <ext:MenuItem runat="server" Text="分类管理">
                                    <Listeners>
                                        <Click Handler="addTab(#{TabPanel1}, 'idCate', 'CategoryManage.aspx');" />
                                    </Listeners>
                                </ext:MenuItem>
                                <ext:MenuSeparator />
                                <ext:MenuItem runat="server" Text="热门产品管理">
                                    <Listeners>
                                        <Click Handler="addTab(#{TabPanel1}, 'idHot', 'HotManage.aspx');" />
                                    </Listeners>
                                </ext:MenuItem>     
                                  <ext:MenuItem ID="MenuItem3" runat="server" Text="相关产品管理">
                                    <Listeners>
                                        <Click Handler="addTab(#{TabPanel1}, 'idHrea', 'ReleatedItemManage.aspx');" />
                                    </Listeners>
                                </ext:MenuItem>
                            </Items>
                        </Menu>
                    </ext:MenuPanel>
                    <ext:MenuPanel Icon="User" ID="MenuPanel3" Title="User" runat="server" Width="200"
                        Region="West">
                        <Menu ID="Menu3" runat="server">
                            <Items>
                                <ext:MenuItem ID="MenuItem1" runat="server" Text="用户管理">
                                    <Listeners>
                                        <Click Handler="addTab(#{TabPanel1}, 'idu', 'UserManage.aspx');" />
                                    </Listeners>
                                </ext:MenuItem>
                                <ext:MenuSeparator />  
                                 <ext:MenuItem ID="MenuItem2" runat="server" Text="模板管理">
                                    <Listeners>
                                        <Click Handler="addTab(#{TabPanel1}, 'idtm', 'TemplateManage.aspx');" />
                                    </Listeners>
                                </ext:MenuItem>
                            </Items>
                        </Menu>
                    </ext:MenuPanel>
                </Items>
            </ext:Panel>
            <ext:TabPanel ID="TabPanel1" runat="server" Region="Center">
                <Items>
                    <ext:Panel ID="Panel5" runat="server" Title="Center" Border="false" Padding="6">
                    </ext:Panel>
                </Items>
            </ext:TabPanel>
        </Items>
    </ext:Viewport>
</body>
</html>
